package test1;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 使用Spring容器实例化Student类,并调用study方法
 */
public class Demo {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext("test1");
        Student student = context.getBean(Student.class);
        student.study();
    }
}
